<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <script type="text/javascript" src="/lib/haha/core/start.js"></script>
    <link rel="stylesheet" href="CSS/resourseDetail.css">
</head>

<body>
    <div id="header"></div>
    <div class="container">
        <div id="saveBox"
            style="min-height:460px;border: 1px solid #CCCCCC;margin-top: 30px;background-color: #ffffff;">
            <script id='detailInfo' type="text/html">
                <p class="title">{{:#data['title']}}</p>
                <!-- 封面 -->
                <div class="posterBox">
                    <ul class="detailContent flex-w-b">
                        <!-- <li class="flex-r-b"><span class='name'>作者：</span><span class="gray">
                            <span class="tag">{{:#data}}</span>;
                        </span></li> -->
                        <li class="flex-r-b"><span class='name'>文献来源：</span><span class="gray">
                                {{:#data['source']}}</span></li>
                        <li class="flex-r-b"><span class='name'>数据库：</span><span class="gray">
                                {{:#data['dataSource']}}</span></li>
                        <li class="flex-r-b"><span class='name'>发表时间：</span><span class="gray">
                                {{:#data['publishDate']}}</span></li>
                        {{if tableCode=='YQTDAK_METADATA'}}
                        <li class="flex-r-b"><span class='name'>类型：</span><span class="gray">
                                {{:#data['type']}}</span></li>
                        <li class="flex-r-b"><span class='name'>文件日期：</span><span class="gray">
                                {{:#data['fileDate']}}</span></li>
                        <li class="flex-r-b"><span class='name'>责任者：</span><span class="gray">
                                {{:#data['responsible']}}</span></li>
                        <li class="flex-r-b"><span class='name'>立卷单位：</span><span class="gray">
                                {{:#data['filingCompany']}}</span></li>
                        <li class="flex-r-b"><span class='name'>保管期限：</span><span class="gray">
                                {{:#data['storagePeriod']}}</span></li>
                        <li class="flex-r-b"><span class='name'>页码：</span><span class="gray">
                                {{:#data['pageNo']}}</span></li>
                        {{/if}}
                        <li class="flex-r-b large" style='margin-top:20px;'><span class="gray">
                                <span id="spanText" class="text">{{:#data['text']}} </span>
                            </span>
                        </li>

                    </ul>
                    <ul class="btns flex">
                        <li class="save" data-tablename='{{:#data["tableCode"]}}' data-dbname='{{:#data["dataSource"]}}'
                            data-sysid='{{:#data["sysId"]}}' data-filename='{{:#data["fileName"]}}'
                            data-title='{{:#data["title"]}}' data-ipAddress={{:~ipAddress(#data,#index)}}>收藏</li>
                        <li class='download' data-tablename='{{:#data["tableCode"]}}'
                            data-dbname='{{:#data["dataSource"]}}' data-sysid='{{:#data["sysId"]}}'
                            data-filename='{{:#data["fileName"]}}' data-title='{{:#data["title"]}}'
                            data-digitfilename='{{:#data["digitFileName"]}}'>下载</li>
                        <li class='preview' data-tablename='{{:#data["tableCode"]}}'
                            data-dbname='{{:#data["dataSource"]}}' data-title='{{:#data["title"]}}'
                            data-sysid='{{:#data["sysId"]}}' data-digitfilename='{{:#data["digitFileName"]}}'>预览</li>
                    </ul>
                </div>
            </script>
        </div>
        <!-- 相似文献 -->
        <!-- <div class="relative">
            <p class="relativeTitle">相似文献</p>
            <ul>
                <li class="flex-between">
                    <p><span>1.</span><span>石油石油石油石油石油石油石油石油石油石油石油石油石油石油</span></p>
                    <p>作者</p>
                </li>
                <li class="flex-between">
                    <p><span>1.</span><span>石油石油石油石油石油石油石油石油石油石油石油石油石油石油</span></p>
                    <p>作者</p>
                </li>
                <li class="flex-between">
                    <p><span>1.</span><span>石油石油石油石油石油石油石油石油石油石油石油石油石油石油</span></p>
                    <p>作者</p>
                </li>
                <li class="flex-between">
                    <p><span>1.</span><span>石油石油石油石油石油石油石油石油石油石油石油石油石油石油</span></p>
                    <p>作者</p>
                </li>
            </ul>
        </div> -->
    </div>
    <div id="footer"></div>
    <!-- 收藏弹窗 -->
    <div id='saveClassify' class='saveClassify' style="display: none;"></div>
    <!-- 侧边固定按钮 -->
    <script type="text/javascript" src="/lib/layer-v3.1.1/layer/layer.js"></script>
    <script src="/lib/layui/layui.js"></script>
    <script type="text/javascript">
        var authorRelate = '',
            organRelate = '',
            keyWordRelate = '',
            vsmen = '',
            vsm = '',
            title = '';
        $(function () {
            var dataDetail = {};
            var sysId = base.getQueryParam('sysId');
            var type = base.getQueryParam('type');
            var tableCode = base.getQueryParam('tableCode');
            if (type == 1) {

                shared.useLayout("act-1", '/news.html');
            } else {
                shared.useLayout("act-1", '/knowledge.html');
            }
            getDetail(sysId);
            function getDetail(sysId) {
                shared.ajaxPost(config.getIndex, {
                    sysId: sysId,
                    tableCode: tableCode
                }, function (res) {
                    // 插入浏览量
                    dataDetail = res;
                    authorRelate = res.authorRelate;
                    organRelate = res.organRelate;
                    keyWordRelate = res.keyWordRelate;
                    vsmen = res.vsmen;
                    vsm = res.vsm;
                    title = res.title;
                    core.useTemplateAuto('detailInfo', res, {
                        ipAddress: function (data, index) {
                            return window.location.search;
                        }
                    })
                    if (type == 1) {
                        // 外部资源
                        $('.download').css('display', 'none');
                        $('.preview').css('display', 'none')
                    }
                    //插入浏览量
                    pageData.isYLVisited({
                        sysId: res.sysId,
                        tableCode: res.tableCode,
                        title: res.title,
                        dataSource: res.dataSource,
                        detailUrl: window.location.pathname,
                        ipAddress: window.location.search,
                    }, config.insertView)
                })
            }
            $('#saveBox').click(function (e) {
                if ($(e.target).hasClass('save')) {
                    if (!shared.getCookie('token')) {
                        window.location.href = '/login.html'
                        return;
                    }
                    pageData.savePop('#saveClassify', 'saveDocument', 'inner', $(e.target));
                } else {
                    pageData.threePart(dataDetail, $(e.target))
                }
            })
        })
    </script>
</body>

</html>